<!doctype html>
<html>
<head>
<meta charset="utf-8">

</head>
<body>

<div id="box"><span></span></div>

<script>


var box = document.getElementById("box");
var span = document.getElementsByTagName("span")[0];

alert(box.compareDocumentPosition(span));


</script>


</body>
</html>
